package org.hxyjs.entity;

import org.hxyjs.vo.MailUser;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author 
 */
public class Parents extends MailUser implements Serializable,Account {
    private String pno;

    private String pimg;

    private String pname;

    private String psex;

    private String page;

    private String pphone;

    private String ppwd;

    private String pid;

    private String pstate;

    private String paddress;

    private String pgrowthvalue;

    private String pdescribe;

    private String pemail;

    private List<Children> childrens;

    private List<Orderrecord> orderrecords;

    public void setAccountRoles(List<AccountRole> accountRoles) {
        this.accountRoles = accountRoles;
    }

    String salt;//加密用的盐

    Integer isDelete;

    Date createDate;

    public Parents() {
    }

    public Parents(String mailAddress, String mailName) {
        super(mailAddress, mailName);
    }

    List<AccountRole> accountRoles;


    public String getSalt() {
        return salt;
    }

    @Override
    public Boolean getLocked() {
        return null;
    }

    @Override
    public String getCredentialsSalt() {
        return getAccountname()+salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    @Override
    public String getAccountid() {
        return pno;
    }

    @Override
    public String getAccountname() {
        return pname;
    }

    @Override
    public String getPassword() {
        return ppwd;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Date getCreateDate() {
        return createDate;
    }

    @Override
    public List<AccountRole> getAccountRoles() {
        return accountRoles ;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public List<Orderrecord> getOrderrecords() {
        return orderrecords;
    }

    public void setOrderrecords(List<Orderrecord> orderrecords) {
        this.orderrecords = orderrecords;
    }

    public List<Children> getChildrens() {
        return childrens;
    }

    public void setChildrens(List<Children> childrens) {
        this.childrens = childrens;
    }

    private static final long serialVersionUID = 1L;

    public String getPno() {
        return pno;
    }

    public void setPno(String pno) {
        this.pno = pno;
    }

    public String getPimg() {
        return pimg;
    }

    public void setPimg(String pimg) {
        this.pimg = pimg;
    }

    public String getPname() {
        return pname;
    }

    public void setPname(String pname) {
        this.pname = pname;
        this.mailName=pname;
    }

    public String getPsex() {
        return psex;
    }

    public void setPsex(String psex) {
        this.psex = psex;
    }

    public String getPage() {
        return page;
    }

    public void setPage(String page) {
        this.page = page;
    }

    public String getPphone() {
        return pphone;
    }

    public void setPphone(String pphone) {
        this.pphone = pphone;
    }

    public String getPpwd() {
        return ppwd;
    }

    public void setPpwd(String ppwd) {
        this.ppwd = ppwd;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getPstate() {
        return pstate;
    }

    public void setPstate(String pstate) {
        this.pstate = pstate;
    }

    public String getPaddress() {
        return paddress;
    }

    public void setPaddress(String paddress) {
        this.paddress = paddress;
    }

    public String getPgrowthvalue() {
        return pgrowthvalue;
    }

    public void setPgrowthvalue(String pgrowthvalue) {
        this.pgrowthvalue = pgrowthvalue;
    }

    public String getPemail() {
        return pemail;
    }

    public void setPemail(String pemail) {
        this.pemail = pemail;
        this.mailAddress=pemail;
    }

    public String getPdescribe() {
        return pdescribe;
    }

    public void setPdescribe(String pdescribe) {
        this.pdescribe = pdescribe;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Parents other = (Parents) that;
        return (this.getPno() == null ? other.getPno() == null : this.getPno().equals(other.getPno()))
            && (this.getPimg() == null ? other.getPimg() == null : this.getPimg().equals(other.getPimg()))
            && (this.getPname() == null ? other.getPname() == null : this.getPname().equals(other.getPname()))
            && (this.getPsex() == null ? other.getPsex() == null : this.getPsex().equals(other.getPsex()))
            && (this.getPage() == null ? other.getPage() == null : this.getPage().equals(other.getPage()))
            && (this.getPphone() == null ? other.getPphone() == null : this.getPphone().equals(other.getPphone()))
            && (this.getPpwd() == null ? other.getPpwd() == null : this.getPpwd().equals(other.getPpwd()))
            && (this.getPid() == null ? other.getPid() == null : this.getPid().equals(other.getPid()))
            && (this.getPstate() == null ? other.getPstate() == null : this.getPstate().equals(other.getPstate()))
            && (this.getPaddress() == null ? other.getPaddress() == null : this.getPaddress().equals(other.getPaddress()))
            && (this.getPgrowthvalue() == null ? other.getPgrowthvalue() == null : this.getPgrowthvalue().equals(other.getPgrowthvalue()))
            && (this.getPemail() == null ? other.getPemail() == null : this.getPemail().equals(other.getPemail()))
            && (this.getPdescribe() == null ? other.getPdescribe() == null : this.getPdescribe().equals(other.getPdescribe()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPno() == null) ? 0 : getPno().hashCode());
        result = prime * result + ((getPimg() == null) ? 0 : getPimg().hashCode());
        result = prime * result + ((getPname() == null) ? 0 : getPname().hashCode());
        result = prime * result + ((getPsex() == null) ? 0 : getPsex().hashCode());
        result = prime * result + ((getPage() == null) ? 0 : getPage().hashCode());
        result = prime * result + ((getPphone() == null) ? 0 : getPphone().hashCode());
        result = prime * result + ((getPpwd() == null) ? 0 : getPpwd().hashCode());
        result = prime * result + ((getPid() == null) ? 0 : getPid().hashCode());
        result = prime * result + ((getPstate() == null) ? 0 : getPstate().hashCode());
        result = prime * result + ((getPaddress() == null) ? 0 : getPaddress().hashCode());
        result = prime * result + ((getPgrowthvalue() == null) ? 0 : getPgrowthvalue().hashCode());
        result = prime * result + ((getPemail() == null) ? 0 : getPemail().hashCode());
        result = prime * result + ((getPdescribe() == null) ? 0 : getPdescribe().hashCode());
        return result;
    }

}